//tile：存放带数字的格子
function Tile(position, value) {
    this.x = position.x; 
    this.y = position.y;
    this.value = value || 2;
    this.previousPosition = null;//previousPosition:之前的位置
    this.mergedFrom = null;//合并 
}
Tile.prototype = {
    // 记录格子上次的位置
    savePosition: function() {
        this.previousPosition = { //previousPosition:之前的位置
        	x: this.x, 
        	y: this.y 
        }; 
    },
    updatePosition: function(position) {
        this.x = position.x;
        this.y = position.y;
    }
}
module.exports = Tile;
